package com.sugar.psych.assessment.module.business.dal.mysql.usertreeholechatrecord;

import java.util.*;

import com.sugar.psych.assessment.framework.common.pojo.PageResult;
import com.sugar.psych.assessment.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.sugar.psych.assessment.framework.mybatis.core.mapper.BaseMapperX;
import com.sugar.psych.assessment.module.business.dal.dataobject.usertreeholechatrecord.UserTreeHoleChatRecordDO;
import org.apache.ibatis.annotations.Mapper;
import com.sugar.psych.assessment.module.business.controller.admin.usertreeholechatrecord.vo.*;

/**
 * 树洞AI聊天会话 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface UserTreeHoleChatRecordMapper extends BaseMapperX<UserTreeHoleChatRecordDO> {

    default PageResult<UserTreeHoleChatRecordDO> selectPage(UserTreeHoleChatRecordPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserTreeHoleChatRecordDO>()
                .eqIfPresent(UserTreeHoleChatRecordDO::getUserId, reqVO.getUserId())
                .likeIfPresent(UserTreeHoleChatRecordDO::getTitle, reqVO.getTitle())
                .betweenIfPresent(UserTreeHoleChatRecordDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserTreeHoleChatRecordDO::getId));
    }

}